#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int JudgePrime(int n){
	if(n==1)
	return 0;
	int m=int(sqrt(n));
	int flag=1;
	for(int i=2;i<=m;i++)
	if(n%i==0){
	flag=0;
	break;
}
	return flag;
}
int main(){
	int count=0;
	for(int i=1;i<=1000;i++){
	if(JudgePrime(i)){
	cout<<i<<"       ";
	count++;
	 if(count%5!=0)
    continue;
    cout<<"\n";
 }
  
}
	return 0;
}
